package com.example.footballsystem.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.footballsystem.entity.Team;
import com.example.footballsystem.entity.TeamPerson;
import com.fasterxml.jackson.databind.ser.Serializers;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TeamPersonMapper extends BaseMapper<TeamPerson> {
    @Select("select * from TeamPerson")
    public List<TeamPerson> getAllTeamPerson();
    @Select("select * from TeamPerson where teamID=#{teamID}")
    public List<TeamPerson> getTeamPersonByTeamID(int teamID);
    @Insert("insert into TeamPerson (teamID, personName, personNum, personRole) VALUES (#{teamID},#{personName},#{personNum},#{personRole})")
    public Boolean addTeamPerson(TeamPerson teamPerson);
    @Delete("delete from TeamPerson where teamID=#{teamId} && personName=#{personName}")
    public Boolean deleteTeamPerson(int teamId,String personName);
}
